<script setup lang="ts">
import HelloWorld from './components/HelloWorld.vue'

import {type FinIntoLibraryPageParam,type FormItemProps} from "./ts/form";
import {reactive, ref} from "vue";
const callbackSelected = ref('')
const loading = ref(true) // 列表的加载中
const list = ref<FinIntoLibraryPageParam[]>([]) // 列表的数据
const list2 = reactive<FinIntoLibraryPageParam[]>([]) // 列表的数据
// 列表的总页数
const total = ref(0)
const finIntoLibraryPageParam = reactive({} as FinIntoLibraryPageParam)
const formItemPropsParam = reactive({} as FormItemProps)

function xxxxxx() {
  formItemPropsParam.error ='121212'
  console.log('=========xxxxxx====' + JSON.stringify(formItemPropsParam.error))
  console.log('=========xxxxxx.total====' + JSON.stringify(total.value))
  console.log('=========xxxxxx.finIntoLibraryPageParam====' + JSON.stringify(finIntoLibraryPageParam))
  loading.value =false
  console.log('=========xxxxxx.loading====' + JSON.stringify(loading.value))
  const newItem: FinIntoLibraryPageParam = {
    // id: Date.now(), // 随机生成一个 ID
    // name: 'New Item',
    // finishedName: 'Not Finished',
    generated: '哈哈哈哈',
    // 地区编号
    finishedNo: "xxxx",
  };
  list.value.push(newItem)
  list.value[0].finishedNo = '修改后'
  console.log('=========xxxxxx.list====' + JSON.stringify(list.value))
  // list2.values().next().value?.finishedName='1111111111'
  // console.log('=========xxxxxx.list2====' + JSON.stringify(list2.value))


}

const handleQuery = (xxx:string) => {
  console.log('=========handleQuery====' + xxx)
  callbackSelected.value = '父页面的修改'
}

</script>

<template>
  <div>
    <div @click="xxxxxx">父页面点击11</div>
    <div @click="handleQuery('哈哈哈')">父页面点击handleQuery</div>
    <a href="https://vite.dev" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <HelloWorld msg="Vite + Vue" />
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
